package com.example.administrator.myapplication;

import android.app.Activity;
import android.net.sip.SipAudioCall;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

import java.util.Date;

/**
 * Created by Administrator on 2016/11/16.
 */

public class Test extends Activity implements View.OnClickListener{
    TextView tv;
    RadioGroup rgd;
    RadioGroup rgp;
    //Button btn;
    //ImageButton btn;
    //EditText et;
    //TextView tv;
    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.scrollviewlayout);

        /*
        setContentView(R.layout.relativelayout);

        TextView tvTitle = (TextView) findViewById(R.id.textviewTitle);
        ImageView iv = (ImageView)findViewById(R.id.imageView);
        tv = (TextView)findViewById(R.id.textview);
        ImageButton ib = (ImageButton)findViewById(R.id.imageButton);
        Button bt = (Button)findViewById(R.id.button);
        CheckBox cb = (CheckBox)findViewById(R.id.checkBox);
        rgd = (RadioGroup)findViewById(R.id.radiogroupdirection);
        rgd.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(){
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                tv.setText(String.valueOf(checkedId));
                switch (checkedId){
                    case R.id.horizontal:
                        rgd.setOrientation(LinearLayout.HORIZONTAL);
                        break;
                    case R.id.vertical:
                        rgd.setOrientation(LinearLayout.VERTICAL);
                        break;
                    default:
                        //tv.setText("defaut");
                        break;
                }
            }
        });
        rgp = (RadioGroup)findViewById(R.id.radiogroupposition);
        rgp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                tv.setText(String.valueOf(checkedId));
                switch (checkedId){
                    case R.id.left:
                        rgp.setGravity(Gravity.LEFT);
                        break;
                    case R.id.center:
                        rgp.setGravity(Gravity.CENTER);
                        break;
                    case R.id.right:
                        rgp.setGravity(Gravity.RIGHT);
                        break;
                    default:
                        break;
                }
            }
        });
        EditText et = (EditText)findViewById(R.id.editText);
        */

    }

    @Override
    public void onClick(View v) {
        updateTime();
    }
    private void updateTime(){
        //btn.setText(new Date().toString());
    }
}
